local DownPillar =class("DownPillar",function()  return CCSprite:create() end)
function DownPillar:ctor()
 local part1 =display.newSprite("pillar1.png",0,0)
 local part2 =display.newSprite("pillar2.png",0,0)
 self:addChild(part1)
 self:addChild(part2)
 local size1 =part1:getContentSize()
 self.size2 =part2:getContentSize()
 local px,py =part2:getPosition()
 display.align(part1,display.CENTER,px-3,size1.height/2+self.size2.height/2)
 self.width =size1.width
 self.height =size1.height+self.size2.height
 part1:setTag(1)
 part2:setTag(2)

end

function DownPillar:fadeOut(d)
  transition.fadeOut(CCNode.getChildByTag(self,1),{time=d})
  transition.fadeOut(CCNode.getChildByTag(self,2),{time=d})
end

function DownPillar:imgWidth()
  return self.width   
end

--设置图片中心位置到 x ,y 注意：Sprite中心点在part1上,而不是图片中心，
function DownPillar:setXY(x,y)
 display.align(self,display.CENTER,x, y-(self.height/2-self.size2.height/2))
end
function  DownPillar:imgHeight()
  return self.height
end
return DownPillar